package org.jmx;

import java.util.ArrayList;
import java.util.List;

public class Teacher implements TeacherMXBean{
    private final int age;
    private final String name;
    private String email;

    private List<Book> books;

    public Teacher(int age, String name, String email) {
        this.age = age;
        this.name = name;
        this.email = email;
        this.books = new ArrayList<>();
    }

    @Override
    public int getAge() {
        return age;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getEmail() {
        return email;
    }

    @Override
    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String sayHello() {
        return "hello " + name;
    }

    @Override
    public List<Book> getBook() {
        return books;
    }

    @Override
    public void addBook(Book book) {
        books.add(book);
    }
}
